<template>
	<Nav :navList="navList" />
	<div class="main-layout">
		<a-form name="tt" v-model="formData" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
			<a-form-item label="用户名" :name="user_name">
				{{ formData.user_name }}
			</a-form-item>
			<a-form-item label="显示名称" :name="user_show_name">
				<a-input v-model:value="formData.user_show_name" />
			</a-form-item>
			<a-form-item label="城市" :name="city_id">
				<a-input v-model:value="formData.city_id" />
			</a-form-item>
			<a-form-item label="身份证" :name="user_id_card">
				<a-input v-model:value="formData.user_id_card" />
			</a-form-item>
			<a-form-item label="注册时间">
				{{ formData.addtime }}
			</a-form-item>
			<a-form-item label="备注" :name="user_remark">
				<a-textarea v-model:value="formData.user_remark" />
			</a-form-item>
			<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
				<a-button type="primary" html-type="submit" @click="submit"> 提 交</a-button>
				<a-button style="margin-left: 10px" @click="resetForm"> 取 消 </a-button>
			</a-form-item>
		</a-form>
	</div>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			formData: {
				user_name: '张三',
			},
			navList: [
				{ to: '/', name: '首页' },
				{ to: '/', name: '设置中心' },
				{ to: '', name: '个人设置' },
			],
		};
	},
	mounted() {
		this.getData();
	},
	methods: {
		getData() {
			var that = this;
			that.$http.post('/manage/SystemUser/GetLoginUser', {}, that, function (ret) {
				that.formData = ret.Data;
			});
		},
		submit() {
			var that = this;
			var entity = {
				user_id: 1,
				user_show_name: that.formData.user_show_name,
				user_id_card: that.formData.user_id_card,
				user_remark: that.formData.user_remark,
			};
			that.$http.post('/manage/SystemUser/Update', entity, that, function (ret) {
				that.$Message['success']({ background: true, duration: 1, content: '更新成功' });
			});
		},
	},
};
</script>
<style scoped>
.main-layout {
	border: 1px solid #f0f0f0;
	padding: 20px;
	width: 600px;
}
</style>
